<!DOCTYPE html>
      <html lang="en">
      <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>yhy-utils</title>
        <style>
          .com-center{
            text-align: center;
          }
          .markdown-body{
            margin: 0 auto;
            padding: 45px;
            width: 60%;
          }
        </style>
      </head>
      <body>
        <h2 class="com-center">yhy-utils</h2>
        <article class="markdown-body">
          <h3 id="initaes">initAes</h3>
<p>  作者：yanghaiyang</p>
<p>  功能描述：初始化Aes加密工具</p>
<table>
<thead>
<tr>
<th align="center">参数名称</th>
<th align="center">说明</th>
<th align="center">参数类型</th>
</tr>
</thead>
<tbody><tr>
<td align="center">keyStr</td>
<td align="center">密钥 默认值&#39;4e8759c58fdb413dcc2c243eebab91f6&#39;</td>
<td align="center">string</td>
</tr>
<tr>
<td align="center">n</td>
<td align="center">位数 默认值9</td>
<td align="center">number</td>
</tr>
</tbody></table>
<pre><code class="language-javascript">            const aesKey = initAes();
            const encryptResult = encrypt(&#39;我是待加密的文本&#39;, aesKey);
            console.log(encryptResult); // skdjfgkjfdgjldfkj3495394jkjwkeh
        
</code></pre>
<h3 id="encrypt">encrypt</h3>
<p>  作者：yanghaiyang</p>
<p>  功能描述：Aes加密</p>
<table>
<thead>
<tr>
<th align="center">参数名称</th>
<th align="center">说明</th>
<th align="center">参数类型</th>
</tr>
</thead>
<tbody><tr>
<td align="center">word</td>
<td align="center">待加密文本</td>
<td align="center">string</td>
</tr>
<tr>
<td align="center">aesKey</td>
<td align="center">预先生成的aeskey</td>
<td align="center">string</td>
</tr>
</tbody></table>
<h3 id="decrypt">decrypt</h3>
<p>  作者：yanghaiyang</p>
<p>  功能描述：Aes解密</p>
<table>
<thead>
<tr>
<th align="center">参数名称</th>
<th align="center">说明</th>
<th align="center">参数类型</th>
</tr>
</thead>
<tbody><tr>
<td align="center">word</td>
<td align="center">待解密的文本</td>
<td align="center">string</td>
</tr>
<tr>
<td align="center">aesKey</td>
<td align="center">预先生成的aeskey</td>
<td align="center">string</td>
</tr>
</tbody></table>
<h3 id=""></h3>
<h3 id="-1"></h3>
<h3 id="-2"></h3>
<h3 id="-3"></h3>
<p>  功能描述：设置缩放的兼容写法</p>
<table>
<thead>
<tr>
<th align="center">参数名称</th>
<th align="center">说明</th>
<th align="center">参数类型</th>
</tr>
</thead>
<tbody><tr>
<td align="center"></td>
<td align="center">dom {HTMLElement}</td>
<td align="center">HTMLElement</td>
</tr>
<tr>
<td align="center"></td>
<td align="center">scale {number}</td>
<td align="center">number</td>
</tr>
</tbody></table>
<h3 id="-4"></h3>
<p>  功能描述：设置指定容器自适应的处理</p>
<table>
<thead>
<tr>
<th align="center">参数名称</th>
<th align="center">说明</th>
<th align="center">参数类型</th>
</tr>
</thead>
<tbody><tr>
<td align="center"></td>
<td align="center">dw {number} 设计稿宽度</td>
<td align="center">number</td>
</tr>
<tr>
<td align="center"></td>
<td align="center">dh {number} 设计稿高度</td>
<td align="center">number</td>
</tr>
<tr>
<td align="center"></td>
<td align="center">dom {HTMLElement} 容器</td>
<td align="center">HTMLElement</td>
</tr>
<tr>
<td align="center"></td>
<td align="center">ignore {IgnoreDom[]} 忽略不缩放的元素</td>
<td align="center">IgnoreDom[]</td>
</tr>
</tbody></table>
<h3 id="-5"></h3>
<h3 id="-6"></h3>
<h3 id="-7"></h3>
<h3 id="-8"></h3>
<p>  功能描述：获取登陆者信息</p>
<h3 id="updateucoins">updateUCoins</h3>
<p>  作者：yanghaiyang</p>
<p>  功能描述：更新账户U币</p>
<table>
<thead>
<tr>
<th align="center">参数名称</th>
<th align="center">说明</th>
<th align="center">参数类型</th>
</tr>
</thead>
<tbody><tr>
<td align="center">at</td>
<td align="center">操作类型    u（代表优币）、z（代表直接扣除或者增加多少优币） 默认为 &#39;u&#39;, 只按照规则code来执行</td>
<td align="center">String</td>
</tr>
<tr>
<td align="center">c</td>
<td align="center">动作编码    优币的规则编码，参照表</td>
<td align="center">String</td>
</tr>
<tr>
<td align="center">n</td>
<td align="center">操作数量    操作类型为 u 时，传固定值 1；操作类型为 z 时，代表直接操作的优币数量</td>
<td align="center">Number</td>
</tr>
<tr>
<td align="center">r</td>
<td align="center">关联数据    关联业务数据 id(比如试卷、视频id)，建议加上系统前缀，避免重复，如：1_10000（找长安）</td>
<td align="center">String</td>
</tr>
<tr>
<td align="center">s</td>
<td align="center">关联系统    1-口算 2-生字 3-互动微课 4-题库 5-资源应用</td>
<td align="center">Number</td>
</tr>
<tr>
<td align="center">i</td>
<td align="center">操作详细说明    中文需要urlencode，为utf8编码, 调用方传入一段说明性文字</td>
<td align="center">String</td>
</tr>
<tr>
<td align="center">tokenParams</td>
<td align="center">给哪个用户更新U币呢 如果是本人 就不用传用户信息，是通过取token来给接口传参的 ，如果是给别人 就传入 { a&quot;:&quot;账号&quot;,&quot;ut&quot;:&quot;账号类型&quot; }</td>
<td align="center">Object</td>
</tr>
</tbody></table>
<pre><code class="language-javascript">            const p = {
              c: &#39;u_tuijianziyuan&#39;,
              r: &#39;1422382363312167_100001&#39;,
              s: 3,
              i: &#39;推荐资源&#39;
            };
             updateUCoins(p).then(res =&gt; {
                  console.log(&#39;res&#39;, res);
             });
        
</code></pre>
<h3 id="deepclone">deepClone</h3>
<p>  作者：hjp</p>
<p>  功能描述：深拷贝对象数据</p>
<table>
<thead>
<tr>
<th align="center">参数名称</th>
<th align="center">说明</th>
<th align="center">参数类型</th>
</tr>
</thead>
<tbody><tr>
<td align="center">obj</td>
<td align="center">对象或者数组</td>
<td align="center">*</td>
</tr>
</tbody></table>
<h3 id="uuid">uuID</h3>
<p>  作者：yanghaiyang</p>
<p>  功能描述：生成唯一标识字符串</p>
<h3 id="-9"></h3>
<table>
<thead>
<tr>
<th align="center">参数名称</th>
<th align="center">说明</th>
<th align="center">参数类型</th>
</tr>
</thead>
<tbody><tr>
<td align="center"></td>
<td align="center">fn 回调</td>
<td align="center"></td>
</tr>
<tr>
<td align="center"></td>
<td align="center">duration 倒计时多久</td>
<td align="center"></td>
</tr>
</tbody></table>
<h3 id="-10"></h3>
<h3 id="-11"></h3>
<h3 id="prependchild">prependChild</h3>
<p>  功能描述：dom元素里面的前面 插入元素</p>
<table>
<thead>
<tr>
<th align="center">参数名称</th>
<th align="center">说明</th>
<th align="center">参数类型</th>
</tr>
</thead>
<tbody><tr>
<td align="center">o</td>
<td align="center">待插入元素</td>
<td align="center">HTMLElement</td>
</tr>
<tr>
<td align="center">s</td>
<td align="center">父元素</td>
<td align="center">HTMLElement</td>
</tr>
</tbody></table>
<h3 id="pulldownrefresh">pullDownRefresh</h3>
<p>  功能描述：给元素添加下拉刷新事件</p>
<table>
<thead>
<tr>
<th align="center">参数名称</th>
<th align="center">说明</th>
<th align="center">参数类型</th>
</tr>
</thead>
<tbody><tr>
<td align="center">refreshContainer</td>
<td align="center">可添加下拉事件的容器</td>
<td align="center">HTMLElement</td>
</tr>
<tr>
<td align="center">outerScroller</td>
<td align="center">外部滚动容器（也可以是下拉事件容器本身）</td>
<td align="center">HTMLElement</td>
</tr>
<tr>
<td align="center">refreshFn</td>
<td align="center">下拉结束之后执行刷新的函数</td>
<td align="center">function</td>
</tr>
</tbody></table>
<h3 id="openwindow">openWindow</h3>
<p>  作者：hjp</p>
<p>  功能描述：打开浏览器新窗口</p>
<table>
<thead>
<tr>
<th align="center">参数名称</th>
<th align="center">说明</th>
<th align="center">参数类型</th>
</tr>
</thead>
<tbody><tr>
<td align="center">url</td>
<td align="center">打开的窗口URL地址</td>
<td align="center">string</td>
</tr>
<tr>
<td align="center">target=&#39;_blank&#39;</td>
<td align="center">是否新开页面</td>
<td align="center">string</td>
</tr>
</tbody></table>
<h3 id="closewindow">closeWindow</h3>
<p>  作者：hjp</p>
<p>  功能描述：关闭浏览器窗口</p>
<h3 id="openwindowcompatibility">openWindowCompatibility</h3>
<p>  功能描述：新开窗口 兼容iframe嵌套新开河safari</p>
<table>
<thead>
<tr>
<th align="center">参数名称</th>
<th align="center">说明</th>
<th align="center">参数类型</th>
</tr>
</thead>
<tbody><tr>
<td align="center">url</td>
<td align="center">打开的窗口URL地址</td>
<td align="center">string</td>
</tr>
</tbody></table>
<h3 id="closewindowcompatibility">closeWindowCompatibility</h3>
<p>  功能描述：关闭新开窗口 兼容iframe嵌套新开河safari</p>
<h3 id="loadscript">loadScript</h3>
<p>  作者：yanghaiyang</p>
<p>  功能描述：动态加载js</p>
<table>
<thead>
<tr>
<th align="center">参数名称</th>
<th align="center">说明</th>
<th align="center">参数类型</th>
</tr>
</thead>
<tbody><tr>
<td align="center"></td>
<td align="center">url 要加载的script文件路径</td>
<td align="center">String</td>
</tr>
<tr>
<td align="center">id</td>
<td align="center">如果传入id 会避免有需要的场景下面重复添加script标签</td>
<td align="center">String</td>
</tr>
</tbody></table>
<h3 id="getos">getOs</h3>
<p>  作者：yanghaiyang</p>
<p>  功能描述：获取系统信息</p>
<h3 id="ismobile">isMobile</h3>
<p>  作者：yanghaiyang</p>
<p>  功能描述：判断是否为移动端</p>
<h3 id="-12"></h3>
<table>
<thead>
<tr>
<th align="center">参数名称</th>
<th align="center">说明</th>
<th align="center">参数类型</th>
</tr>
</thead>
<tbody><tr>
<td align="center"></td>
<td align="center">designWidth</td>
<td align="center"></td>
</tr>
<tr>
<td align="center"></td>
<td align="center">designHeight</td>
<td align="center"></td>
</tr>
<tr>
<td align="center"></td>
<td align="center">renderDom</td>
<td align="center"></td>
</tr>
</tbody></table>

        </article>
      </body>
      </html>